<!--必须引入的代码,进行编码控制和变量控制 start-->
<%@page pageEncoding="UTF-8" %>
<%@ taglib uri="/set" prefix="set" %>
<set:set/>
<!--必须引入的代码,进行编码控制和变量控制 end-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<!--<![endif]-->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>drds.common.center</title>
    <link rel="dns-prefetch" href="https://s.w.org/">
    <link rel="stylesheet" href="${__PUBLIC__}/login/load-styles.php"
          type="text/css" media="all">
    <link rel="stylesheet" href="${__PUBLIC__}/login/login.css"
          media="all"/>
    <meta name="robots" content="noindex,follow">
    <meta name="viewport" content="integer=device-integer">
</head>
<body class="login login-action-login wp-core-ui  locale-zh-cn">
<div id="login">
    <h1>
        <a href="" title="" tabindex="-1">DRDS.Service</a>
    </h1>

    <form name="loginform" id="loginform" method="post" onsubmit="return false">
        <p>
            <label for="user_name">用户名或电子邮件地址<br> <input
                    type="text" name="log" id="user_name" class="input" value=""
                    size="20"></label>
        </p>
        <p>
            <label for="user_password">密码<br> <input type="password"
                                                     name="pwd" id="user_password" class="input" value=""
                                                     size="20"></label>
        </p>
        <p class="forgetmenot">
            <label for="rememberme"><input name="rememberme"
                                           type="checkbox" id="rememberme" value="forever"> 记住我的登录信息</label>
        </p>
        <p class="submit">
            <input type="submit" name="wp-submit" id="wp-submit"
                   class="button button-primary button-large" value="登录" onclick="login()">
            <input type="hidden" name="testcookie" value="1">
        </p>
    </form>

    <p id="nav">
        <a href="#">忘记密码？</a>
    </p>


</div>


<div class="clear"></div>
<script src="${__PUBLIC__}/js/jquery-3.2.1.min.js"></script>
<script src="${__PUBLIC__}/layer/layer.js"></script>
<script type="text/javascript">
    /**
     * 登录验证
     */
    function login() {
        var user_name = jQuery("#user_name").val();
        var user_password = jQuery("#user_password").val();
        var _data = {//
            user_name: user_name, user_password: user_password
        };//
        console.log("开始登录验证")
        var message = jQuery.ajax({
            type: 'POST',
            url: "${__ROOT__}/index/login.html",
            async: false,
            data: _data
        }).responseText;
        var object = jQuery.parseJSON(message);

        if (object.code != "0") {
            layer.msg(object.msg);
            return;
        } else {
            window.location.href = "${__ROOT__}/admin/index.html";
        }
    }


</script>

</body>
</html>